{extend name="base" /} {block name="body"}
<div class="layui-body">
	<div class="navbar">
		<a><cite>商品管理</cite></a>&nbsp;<span class="layui-box">&gt;</span>
		<a href=""><cite>订房列表</cite></a>
	</div>		
	<!--tab标签-->
	<div class="layui-tab layui-tab-brief">
		<ul class="layui-tab-title">
			<li class="layui-this">订房管理</li>
			<li class="">
				<a href="{:url('beauthome/add')}">添加订房</a>
			</li>
		</ul>
		<div class="layui-tab-content">
			<form class="layui-form layui-form-pane" action="{:url('beauthome/index')}" method="get">
				<div class="layui-inline">
					<label class="layui-form-label">关键词</label>
					<div class="layui-input-inline">
						<input type="text" name="keyword" value="{$keyword}" placeholder="请输入关键词" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<select name="ziduan">
						<option value="id" {if $ziduan=='goods_id' }selected{/if}>订房ID</option>
						<option value="goods_sn" {if $ziduan=='goods_sn' }selected{/if}>订房编号</option>
						<option value="goods_name" {if $ziduan=='goods_name' }selected{/if}>订房名称</option>
					</select>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">排序</label>
					<div class="layui-input-inline">
						<select name="param">
							<option value="add_time" {if $param=='add_time' }selected{/if}>添加时间</option>
							<option value="sale_price" {if $param=='sale_price' }selected{/if}>价格</option>
						</select>
					</div>
				</div>
				<div class="layui-inline">
					<select name="sort">
						<option value="asc" {if $sort=='asc' }selected{/if}>从低到高</option>
						<option value="desc" {if $sort=='desc' }selected{/if}>从高到底</option>
					</select>
				</div>
				<div class="layui-inline">
					<button class="layui-btn">搜索</button>
				</div>
			</form>
			<hr>
			<table class="layui-table layui-form">
				<thead>
					<tr>
						<th>ID</th>
						<th>订房编号</th>
						<th>订房名称</th>
						<th>订房图片</th>
						<th>价格</th>
						<th>定金</th>
						<th>添加时间</th>
						<th>是否显示</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<form id="listForm">
					{foreach name="home_list" item="vo"}
					<tr>
						<td>{$vo.id}</td>
						<td>{$vo.home_sn}</td>
						<td>{$vo.home_name}</td>
						<td><img style="width: 50px;height: 50px;" src="{$vo.thumb}" /></td>
						<td>{$vo.cost_price}</td>
						<td>{$vo.sale_price}</td>
						<td>{$vo.add_time}</td>
						<td><input type="checkbox" data-href="{:url('status',['table'=>'beaut_home','id'=>$vo.id])}" {if $vo.is_on_sale==1}checked{/if} value="{$vo.is_on_sale}" lay-skin="switch" lay-filter="switchStatus" lay-text="显示|隐藏"></td>
						<td>	
							<a href="{:url('beauthome/reservelist',['id'=>$vo['id']])}" class="layui-btn layui-btn-small">预定信息</a>
							<a href="{:url('beauthome/edit',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-small"><i class="fa fa-edit"></i>编辑</a>
							<a ref="delete_item?id={$vo.id}" class="layui-btn layui-btn-danger layui-btn-small confirm"><i class="fa fa-trash-o"></i>删除</a>
						</td>
					</tr>
					{/foreach}
					</form>
				</tbody>
			</table>
			<!--分页-->
			{$home_list->render()}
		</div>
	</div>
</div>
<script>
	// 定义全局JS变量
	var GV = {
		current_controller: "{$controller}/index"
	};
</script>
{/block}